package sample;

import javafx.scene.Group;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;

public class AppFrame {
    boolean used;

    Rectangle rectangle;
    public double Weight;
    public double Hight;
    public AppFrame(){
        used = false;
        rectangle = new Rectangle();
        rectangle.setStyle("-fx-stroke-width:3;");
        rectangle.setFill(Color.TRANSPARENT);
        rectangle.setStroke(Color.rgb(255,255,0));
        rectangle.setViewOrder(1);


    }
    public AppFrame(double startx,double starty,double width,double height){
        used = false;
        rectangle = new Rectangle();
        rectangle.setStyle("-fx-stroke-width:3;");
        rectangle.setFill(Color.TRANSPARENT);
        rectangle.setStroke(Color.rgb(255,255,0));
        rectangle.setViewOrder(1);
        rectangle.setX(startx);
        rectangle.setY(starty);
        rectangle.setHeight(height);
        rectangle.setWidth(width);

    }
    public void addFrameTo(Group root){
        root.getChildren().add(rectangle);
    }
    public void setFrame(double startx,double starty,double width,double height){

        rectangle.setX(startx);
        rectangle.setY(starty);
        rectangle.setHeight(height);
        rectangle.setWidth(width);

    }
    public void setUsed(boolean using){
        used = using;
    }
    public boolean isUsed(){
        return used;
    }
    public void setColor(Color color){

        rectangle.setStroke(color);
    }
}
